<template>
<div class="view-home">
	<Child1 :username1='username1' :username2='username2' @testAdd1='testAdd1'></Child1>
	<Child2></Child2>
</div>
</template>

<script>
// @ is an alias to /src
import Child1 from '@/components/Child1'
import Child2 from '@/components/Child2'
export default {
	name: 'Communication',
	components: {
		Child1,
		Child2,
	},
	mounted () {
		this.$children[0].add1()
        //console.log(this.$children[0].add1());
    },
    provide: {
    	usertest1: 'usertest111',
    	usertest2: 'usertest222',
    },
	data () {
		return {
			username1: '123',
			username2: 'aa22',
		};
	},
	methods: {
		testAdd1 (val) {
			console.log('Communication:', val);
		},
		testAdd2 (val) {
			console.log('Communication:', val);
		},
		testAdd3 (val) {
			console.log('Communication:', val);
		},
	},
}
</script>
